home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1994 November: Tool Chest / Dev.CD Nov 94.toast / Sample Code / Newton Sample Code 1.2 / Views / ModalFun-2 / Modal.text < prev    next >
Encoding:
Text File  |  1994-02-28  |  5.2 KB  |  233 lines  |  [TEXT/MPS ]

  1.  
  2. // ---- End Project Data ----
  3.  
  4.  
  5. // ---- File main.t ----
  6.  
  7. // Before Script for "myBase"
  8. // Copyright © 1993, 1994 by Apple Computer, Inc.  All rights reserved.
  9.  
  10. myBase :=
  11.    {title: "Modal Fun",
  12.     viewBounds: {left: -4, top: 98, right: 223, bottom: 261},
  13.     doModal:
  14.       func(theView)
  15.       begin
  16.          // send the ModalDialog message to the view
  17.          // identified by theModalView
  18.          // this is done as a deferred action.
  19.          // see the buttonClickScript in the protoTextButton
  20.          theView:ModalDialog();
  21.       end,
  22.     viewQuitScript:
  23.       func()
  24.       begin
  25.           if theModal then
  26.               theModal:?Close();
  27.       end,
  28.     _proto: protoApp,
  29.     debug: "myBase"
  30.    };
  31.  
  32.  
  33. // Before Script for "_view000"
  34. // Copyright © 1993, 1994 by Apple Computer, Inc.  All rights reserved.
  35.  
  36. _view000 := /* child of myBase */
  37.    {text: "Modal Me",
  38.     buttonClickScript:
  39.       func()
  40.       begin
  41.          // MUST send the ModalDialog message as a deferred
  42.          // action, otherwise events can go awry.
  43.          AddDeferredAction(doModal, [theModal]);
  44.       end,
  45.     viewBounds: {left: 74, top: 122, right: 148, bottom: 140},
  46.     _proto: protoTextButton
  47.    };
  48.  
  49.  
  50.  
  51. // ---- File modal.t ----
  52.  
  53. // Before Script for "theModal"
  54. // Copyright © 1993, 1994 by Apple Computer, Inc.  All rights reserved.
  55.  
  56. theModal := /* child of myBase */
  57.    {viewFlags: 512,
  58.     viewFormat: 256,
  59.     viewBounds: {left: 0, top: 0, right: 0, bottom: 0},
  60.     viewJustify: 240,
  61.     declareSelf: 'modal,
  62.     viewClickScript:
  63.       // viewClickScript to absorb all taps.
  64.       
  65.       func(unit)
  66.       begin
  67.           print("click");
  68.           TRUE;
  69.       end,
  70.     viewclass: 74,
  71.     debug: "theModal"
  72.    };
  73. // View theModal is declared to myBase
  74.  
  75.  
  76. // Before Script for "_view001"
  77. // Copyright © 1993, 1994 by Apple Computer, Inc.  All rights reserved.
  78.  
  79. _view001 := /* child of theModal */
  80.    {viewFlags: 1,
  81.     viewFormat: 83886673,
  82.     viewBounds: {left: 32, top: 24, right: 216, bottom: 136},
  83.     viewclass: 74
  84.    };
  85.  
  86.  
  87. // Before Script for "_view002"
  88. // Copyright © 1993, 1994 by Apple Computer, Inc.  All rights reserved.
  89.  
  90. _view002 := /* child of _view001 */
  91.    {text: "OK",
  92.     buttonClickScript:
  93.       func()
  94.       begin
  95.          // the topmost clView for this dialog has a declareSelf
  96.          // slot with the value 'modal, so this will close it.
  97.          modal:Close();
  98.       end,
  99.     viewBounds: {left: 34, top: 82, right: 90, bottom: 98},
  100.     _proto: protoTextButton
  101.    };
  102.  
  103.  
  104.  
  105.  
  106. // Before Script for "_view003"
  107. // Copyright © 1993, 1994 by Apple Computer, Inc.  All rights reserved.
  108.  
  109. _view003 := /* child of _view001 */
  110.    {text: "Ick... A Modal dialog! Ick!",
  111.     viewBounds: {left: 25, top: 33, right: 153, bottom: 49},
  112.     _proto: protoStaticText
  113.    };
  114.  
  115.  
  116.  
  117.  
  118. // Before Script for "_view004"
  119. // Copyright © 1993, 1994 by Apple Computer, Inc.  All rights reserved.
  120.  
  121. _view004 := /* child of _view001 */
  122.    {text: "Cancel",
  123.     buttonClickScript:
  124.       func()
  125.       begin
  126.          // the topmost clView for this dialog has a declareSelf
  127.          // slot with the value 'modal, so this will close it.
  128.          modal:Close();
  129.       end,
  130.     viewBounds: {left: 107, top: 83, right: 163, bottom: 99},
  131.     _proto: protoTextButton
  132.    };
  133.  
  134.  
  135.  
  136.  
  137.  
  138.  
  139. // ---- Back in File main.t ----
  140.  
  141.  
  142.  
  143.  
  144.  
  145. // ---- Beginning of section for non used Layout files ----
  146.  
  147. // ---- File modal.t ----
  148.  
  149. // Before Script for "_view005"
  150. // Copyright © 1993, 1994 by Apple Computer, Inc.  All rights reserved.
  151.  
  152. _view005 :=
  153.    {viewFlags: 512,
  154.     viewFormat: 256,
  155.     viewBounds: {left: 0, top: 0, right: 0, bottom: 0},
  156.     viewJustify: 240,
  157.     declareSelf: 'modal,
  158.     viewClickScript:
  159.       // viewClickScript to absorb all taps.
  160.       
  161.       func(unit)
  162.       begin
  163.           print("click");
  164.           TRUE;
  165.       end,
  166.     viewclass: 74
  167.    };
  168.  
  169.  
  170. // Before Script for "_view006"
  171. // Copyright © 1993, 1994 by Apple Computer, Inc.  All rights reserved.
  172.  
  173. _view006 := /* child of _view005 */
  174.    {viewFlags: 1,
  175.     viewFormat: 83886673,
  176.     viewBounds: {left: 32, top: 24, right: 216, bottom: 136},
  177.     viewclass: 74
  178.    };
  179.  
  180.  
  181. // Before Script for "_view007"
  182. // Copyright © 1993, 1994 by Apple Computer, Inc.  All rights reserved.
  183.  
  184. _view007 := /* child of _view006 */
  185.    {text: "OK",
  186.     buttonClickScript:
  187.       func()
  188.       begin
  189.          // the topmost clView for this dialog has a declareSelf
  190.          // slot with the value 'modal, so this will close it.
  191.          modal:Close();
  192.       end,
  193.     viewBounds: {left: 34, top: 82, right: 90, bottom: 98},
  194.     _proto: protoTextButton
  195.    };
  196.  
  197.  
  198.  
  199.  
  200. // Before Script for "_view008"
  201. // Copyright © 1993, 1994 by Apple Computer, Inc.  All rights reserved.
  202.  
  203. _view008 := /* child of _view006 */
  204.    {text: "Ick... A Modal dialog! Ick!",
  205.     viewBounds: {left: 25, top: 33, right: 153, bottom: 49},
  206.     _proto: protoStaticText
  207.    };
  208.  
  209.  
  210.  
  211.  
  212. // Before Script for "_view009"
  213. // Copyright © 1993, 1994 by Apple Computer, Inc.  All rights reserved.
  214.  
  215. _view009 := /* child of _view006 */
  216.    {text: "Cancel",
  217.     buttonClickScript:
  218.       func()
  219.       begin
  220.          // the topmost clView for this dialog has a declareSelf
  221.          // slot with the value 'modal, so this will close it.
  222.          modal:Close();
  223.       end,
  224.     viewBounds: {left: 107, top: 83, right: 163, bottom: 99},
  225.     _proto: protoTextButton
  226.    };
  227.  
  228.  
  229.  
  230.  
  231.  
  232.  
  233. // End of output